/**
 * 显示 tooltip
 * @param mydata
 * @param params
 * @param n
 * @returns {string}
 */
function showTooltip(mydata, params, n) {
    let x = params.dataIndex;
    let y = params.componentIndex;
    let str = '<div">';
    let i = Math.floor(y / n);

    str = str +
        '<p style="text-align: center;color: black;font-size: 20px;margin-bottom: 10px;">' + mydata.shop[x] + '</p>';

    // 当期
    if (i == 0) {
        str = str + '<p style="width: 100%;text-align: center;font-size: 20px;margin-bottom: 5px;color: ' + params.color + '">当期</p>';
        let ys = y % n;

        if (ys == 0) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">产品占比</span> <span class="span-right">' +
                (mydata.dq.产品占比[x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">产品占比</span> <span class="span-right">' +
                (mydata.dq.产品占比[x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 1) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">人工占比</span> <span class="span-right">' +
                (mydata.dq.人工占比[x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">人工占比</span> <span class="span-right">' +
                (mydata.dq.人工占比[x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 2) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">综合管理费占比（各仓）</span> <span class="span-right">' +
                (mydata.dq["综合管理费占比（各仓）"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">综合管理费占比（各仓）</span> <span class="span-right">' +
                (mydata.dq["综合管理费占比（各仓）"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 3) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">五项费用</span> <span class="span-right">' +
                (mydata.dq.五项费用[x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">五项费用</span> <span class="span-right">' +
                (mydata.dq.五项费用[x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 4) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">其他费用（房租、折旧）</span> <span class="span-right">' +
                (mydata.dq["其他费用（房租、折旧）"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">其他费用（房租、折旧）</span> <span class="span-right">' +
                (mydata.dq["其他费用（房租、折旧）"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 5) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">平台费用占比（包含售后）</span> <span class="span-right">' +
                (mydata.dq["平台费用占比（包含售后）"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">平台费用占比（包含售后）</span> <span class="span-right">' +
                (mydata.dq["平台费用占比（包含售后）"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 6) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">推广费用占比</span> <span class="span-right">' +
                (mydata.dq["推广费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">推广费用占比</span> <span class="span-right">' +
                (mydata.dq["推广费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 7) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">物流费用占比</span> <span class="span-right">' +
                (mydata.dq["物流费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">其他费用（房租、折旧）</span> <span class="span-right">' +
                (mydata.dq["物流费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 8) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">包装费用占比</span> <span class="span-right">' +
                (mydata.dq["包装费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">包装费用占比</span> <span class="span-right">' +
                (mydata.dq["包装费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 9) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">费用占比合计</span> <span class="span-right">' +
                (mydata.dq["费用占比合计"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">费用占比合计</span> <span class="span-right">' +
                (mydata.dq["费用占比合计"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 10) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">利润比例</span> <span class="span-right">' +
                (mydata.dq["利润比例"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">利润比例</span> <span class="span-right">' +
                (mydata.dq["利润比例"][x] * 100).toFixed(2) + '%</span></p>';
        }
    }
    // 同比
    else if (i == 1) {
        str = str + '<p style="width: 100%;text-align: center;font-size: 20px;margin-bottom: 5px;color: ' + params.color + '">同比</p>';
        let ys = y % n;

        if (ys == 0) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">产品占比</span> <span class="span-right">' +
                (mydata.tb.产品占比[x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">产品占比</span> <span class="span-right">' +
                (mydata.tb.产品占比[x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 1) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">人工占比</span> <span class="span-right">' +
                (mydata.tb.人工占比[x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">人工占比</span> <span class="span-right">' +
                (mydata.tb.人工占比[x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 2) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">综合管理费占比（各仓）</span> <span class="span-right">' +
                (mydata.tb["综合管理费占比（各仓）"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">综合管理费占比（各仓）</span> <span class="span-right">' +
                (mydata.tb["综合管理费占比（各仓）"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 3) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">五项费用</span> <span class="span-right">' +
                (mydata.tb.五项费用[x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">五项费用</span> <span class="span-right">' +
                (mydata.tb.五项费用[x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 4) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">其他费用（房租、折旧）</span> <span class="span-right">' +
                (mydata.tb["其他费用（房租、折旧）"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">其他费用（房租、折旧）</span> <span class="span-right">' +
                (mydata.tb["其他费用（房租、折旧）"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 5) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">平台费用占比（包含售后）</span> <span class="span-right">' +
                (mydata.tb["平台费用占比（包含售后）"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">平台费用占比（包含售后）</span> <span class="span-right">' +
                (mydata.tb["平台费用占比（包含售后）"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 6) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">推广费用占比</span> <span class="span-right">' +
                (mydata.tb["推广费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">推广费用占比</span> <span class="span-right">' +
                (mydata.tb["推广费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 7) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">物流费用占比</span> <span class="span-right">' +
                (mydata.tb["物流费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">物流费用占比</span> <span class="span-right">' +
                (mydata.tb["物流费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 8) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">包装费用占比</span> <span class="span-right">' +
                (mydata.tb["包装费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">包装费用占比</span> <span class="span-right">' +
                (mydata.tb["包装费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 9) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">费用占比合计</span> <span class="span-right">' +
                (mydata.tb["费用占比合计"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">费用占比合计</span> <span class="span-right">' +
                (mydata.tb["费用占比合计"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 10) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">利润比例</span> <span class="span-right">' +
                (mydata.tb["利润比例"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">利润比例</span> <span class="span-right">' +
                (mydata.tb["利润比例"][x] * 100).toFixed(2) + '%</span></p>';
        }
    }
    // 环比
    else {
        str = str + '<p style="width: 100%;text-align: center;font-size: 20px;margin-bottom: 5px;color: ' + params.color + '">环比</p>';
        let ys = y % n;

        if (ys == 0) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">产品占比</span> <span class="span-right">' +
                (mydata.hb.产品占比[x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">产品占比</span> <span class="span-right">' +
                (mydata.hb.产品占比[x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 1) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">人工占比</span> <span class="span-right">' +
                (mydata.hb.人工占比[x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">人工占比</span> <span class="span-right">' +
                (mydata.hb.人工占比[x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 2) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">综合管理费占比（各仓）</span> <span class="span-right">' +
                (mydata.hb["综合管理费占比（各仓）"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">综合管理费占比（各仓）</span> <span class="span-right">' +
                (mydata.hb["综合管理费占比（各仓）"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 3) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">五项费用</span> <span class="span-right">' +
                (mydata.hb.五项费用[x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">五项费用</span> <span class="span-right">' +
                (mydata.hb.五项费用[x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 4) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">其他费用（房租、折旧）</span> <span class="span-right">' +
                (mydata.hb["其他费用（房租、折旧）"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">其他费用（房租、折旧）</span> <span class="span-right">' +
                (mydata.hb["其他费用（房租、折旧）"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 5) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">平台费用占比（包含售后）</span> <span class="span-right">' +
                (mydata.hb["平台费用占比（包含售后）"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">平台费用占比（包含售后）</span> <span class="span-right">' +
                (mydata.hb["平台费用占比（包含售后）"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 6) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">推广费用占比</span> <span class="span-right">' +
                (mydata.hb["推广费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">推广费用占比</span> <span class="span-right">' +
                (mydata.hb["推广费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 7) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">物流费用占比</span> <span class="span-right">' +
                (mydata.hb["物流费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">物流费用占比</span> <span class="span-right">' +
                (mydata.hb["物流费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 8) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">包装费用占比</span> <span class="span-right">' +
                (mydata.hb["包装费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">包装费用占比</span> <span class="span-right">' +
                (mydata.hb["包装费用占比"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 9) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">费用占比合计</span> <span class="span-right">' +
                (mydata.hb["费用占比合计"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">费用占比合计</span> <span class="span-right">' +
                (mydata.hb["费用占比合计"][x] * 100).toFixed(2) + '%</span></p>';
        }

        if (ys == 10) {
            str = str + '<p style="color: ' + params.color + ';box-shadow:0 0 5px ' + params.color + ';"><span class="span-left">利润比例</span> <span class="span-right">' +
                (mydata.hb["利润比例"][x] * 100).toFixed(2) + '%</span></p>';
        } else {
            str = str + '<p><span class="span-left">利润比例</span> <span class="span-right">' +
                (mydata.hb["利润比例"][x] * 100).toFixed(2) + '%</span></p>';
        }
    }

    return str + '</div>';
}